<?php
/*******************************************************************************
 * 3 column dashboard
 * 3 column replacement riverdashboard miniprofile
 *
 * @package 3 column dashboard
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
 * @author Fusion <contact@donkeydesigns.us>
 * @copyright TheFloridaCircle.com 2008-2009
 * @link http://www.thefloridacircle.com/
 *
 ******************************************************************************/
?>
<div id="river_container2">
<div class="dash_pad">

<?php 
if (isloggedin()){
?>

<script type="text/javascript">
$(document).ready(function()
{
  //hide the all of the element with class msg_body2
  $("msg_body2").hide();
  //toggle the componenet with class msg_body2
  $(".msg_header").click(function()
  {
    $("msg_body2").slideToggle(200);
  });
});
</script>

<div class="contentWrapper3" align="center">

<table border="0" cellspacing="0" cellpadding="0">

  <tr>
    <td><div align="center">  
    <!-- welcome message -->
        <div><div align="center">
        	
         
 <div>     
 <?php

	// Get entity
		if (empty($vars['entity']))
			$vars['entity'] = $vars['user'];

		if ($vars['entity'] instanceof ElggUser) {
			
		$name = htmlentities($vars['entity']->name, ENT_QUOTES, 'UTF-8');
		$username = $vars['entity']->username;
		
		if ($icontime = $vars['entity']->icontime) {
			$icontime = "{$icontime}";
		} else {
			$icontime = "default";
		}
			
	// Get size
		if (!in_array($vars['size'],array('small','medium','large','tiny','master','topbar')))
			$vars['size'] = "large";
			
	// Get any align and js
		if (!empty($vars['align'])) {
			$align = " align=\"{$vars['align']}\" ";
		} else {
			$align = "";
		}

	// Override
		if (isset($vars['override']) && $vars['override'] == true) {
			$override = true;
		} else $override = false;
		
		if (!$override) {
		
?>
<div class="usericon">

	
	<?php
		if ((isadminloggedin()) || (!$vars['entity']->isBanned())) {
	 ?><a href="<?php echo $vars['entity']->getURL(); ?>" class="icon" ><?php 
		}
		
	} 
	
	?><img src="<?php echo $vars['entity']->getIcon($vars['size']); ?>" border="0" <?php echo $align; ?> title="<?php echo htmlentities($vars['entity']->name, ENT_QUOTES, 'UTF-8'); ?>" <?php echo $vars['js']; ?> /><?php

		if (!$override) {
	
	?></a><div class="sub_menu">
		<a href="<?php echo $vars['entity']->getURL(); ?>"><h3><?php echo $vars['entity']->name; ?></h3></a>
		<?php
			if (isloggedin()) {
				$actions = elgg_view('profile/menu/actions',$vars);
				if (!empty($actions)) {
					
					echo "<div class=\"item_line\">{$actions}</div>";
					
				}
				if ($vars['entity']->getGUID() == $vars['user']->getGUID()) {
					echo elgg_view('profile/menu/linksownpage',$vars);
				} else {
					echo elgg_view('profile/menu/links',$vars);
				}					
			} else {
				echo elgg_view('profile/menu/links',$vars);
			}
		?>
	</div>	
</div>

<?php

	}
		}

?>
 
 
 
 </div>
            
    <div align="center">          
	<?php
        		    
	    echo "<h2 style=\"font-size:12px; margin-top:3px;\">" . elgg_echo("Hi ") . " ";
        echo $vars['user']->name;
        echo "</h2>";
    	?>
         </div>   
                           
      	  </div></div>
        </div></td>
  </tr>
  <tr>
    <td><div align="center" style="font-size:9px;"><? print(Date("l F d, Y")); ?> </div></td>
  </tr>
  <tr>
  <td><?php
	$current_count = get_loggedin_user()->getAnnotations("profilecount");
	
	if(!$current_count){
		$current_count = 0;
	} else {
		$current_count = $current_count[0]->value;
	}
	
?>
<div align="center" style="font-size:11px; font-weight:bold;">
	<?php echo sprintf(elgg_echo('river:stats:currentcount'),$current_count); ?>
</div></td>
  </tr>
  
<?php if (is_plugin_enabled('userpoints')){ ?>
  <tr>
  <td><div align="center" style="font-size:11px;"><b><?php
  $upperplural = get_plugin_setting('upperplural', 'userpoints');
  echo $upperplural . ': ' . $vars['entity']->userpoints_points;?></b></div></td>
  </tr>
<?php } ?>

<?php if (is_plugin_enabled('vazco_karma')) { ?>
    <tr><td style="font-size:11px; font-weight:bold"><center>
    <!--<hr style="color:silver; background-color:silver;" />-->
    <?php
global $CONFIG;
if ($vars['size'] == 'large'){ 
	$karma = new vazco_karma();
	$user = $vars['entity'];
	if ($karma->showPointsOnProfile()){
		$points = $karma->getUserPoints($user);
		$rank = $karma->getUserRank($user);
?>
	<div class="karma_profile_points1">
		<div><span class="karma_profile_header"><?php echo elgg_echo('vazco_karma:profile:points');?></span> <span><?php echo $points;?></span></div>
		<div><span class="karma_profile_header"><?php echo elgg_echo('vazco_karma:profile:rank');  ?></span> <span><?php echo $rank;?></span></div>
		<?php if (isadminloggedin() || $user->guid == get_loggedin_userid()){?>
		<div class="vazco_points_history"><a href="<?php echo $CONFIG->wwwroot;?>pg/vazco_karma/history/<?php echo $user->username;?>"><?php echo elgg_echo('vazco_karma:history:menu');?></a></div>
		<?php }?>
	</div>
<?php }
}?>
    </center></td></tr>
<?php }?>  
   </table>
   </div>
  <hr style="color:silver; background-color:silver; width:80%;" /> 
   <center>
   <div>Photos: <?php if(get_context() == 'photos') echo 'profile_select';?>
		<a href="<?php echo $vars['url']; ?>pg/photos/owned/<?php echo $_SESSION['user']->username; ?>"><?php echo elgg_echo("Edit/Upload"); ?></a>	
	</div>
    
    <div>Videos: <?php if(get_context() == 'izap_videos') echo 'profile_select';?>
		<a href="<?php echo $vars['url']; ?>pg/izap_videos/<?php echo $_SESSION['user']->username; ?>"><?php echo elgg_echo("Edit/Upload"); ?></a>	
	</div>
    
    <div><?php if(get_context() == 'blogs') echo 'profile_select';?>
		<a href="<?php echo $vars['url']; ?>pg/blog/<?php echo $_SESSION['user']->username; ?>"><?php echo elgg_echo("Manage Blog"); ?></a>	
	</div>
    
    <div><?php if(get_context() == 'blogs') echo 'profile_select';?>
		<a href="<?php echo $vars['url']; ?>pg/groups/member/<?php echo $_SESSION['user']->username; ?>"><?php echo elgg_echo("Manage Groups"); ?></a>	
	</div>
    <div><?php if(get_context() == 'omni_inviter') echo 'profile_select'; ?>
    <a href="<?php echo $vars['url']; ?>mod/invitefriends/"><?php echo elgg_echo("Invite Your Friends");?></a>
    </div>
   </center>
   
     <!-- collapsible divs using jquery.js -->
  <div align="center">
  
   <div id="profile_info_column_left">
   <div id="profile_icon_wrapper">
    
  
    
  
<!-- <div class="msg_list"> -->

<h3 class="msg_header">Manage Account</h3>
<div class="msg_body2">

	<div style="margin-left:-40px">
	<h3 style="font-size:15px;">Customize account</h3>
	<div  align="center">
		<div><a href="<?php echo $vars['url']; ?>pg/customstyle/" class="usersettings"><?php echo elgg_echo('river:mini:custom_profile'); ?></a></div>
		<div><a href="<?php echo $vars['url']; ?>mod/profile/editicon.php" class="usersettings"><?php echo elgg_echo('river:mini:profile_image'); ?></a></div>	 
	</div>
	
	
	<h3 style="font-size:15px;">Edit account</h3>
	<div  align="center">
		    <div><a href="<?php echo $vars['url']; ?>pg/settings/" class="usersettings"><?php echo elgg_echo('river:mini:account_settings'); ?></a></div>
			<div><a href='<?php echo $vars['url'];?>mod/profile/edit.php?username=<?php echo $_SESSION['user']->name; ?>'><?php echo elgg_echo('river:mini:edit_profile'); ?></a></div>  
	</div>
	</div>
		
<!-- code end -->
</div><!-- /End of msg_body2 -->
<!-- </div> /msg_list -->
</div><!-- /profile_icon_wrapper -->
</div><!-- /profile_info_column_left -->
</div><!-- /center -->
<!-- miniprofile end here -->
<?php
	} // End of isloggedin
?>
</div><!-- /dash_pad -->
</div><!-- /river_container2 -->
<div class="clearfloat"></div>